import { BasicComponent } from './basic/basic.component';
import { ConfirmComponent } from './confirm/confirm.component';
import { CustomizeComponent } from './customize/customize.component';

export const MessageBoxConfig = {
  location: 'MessageBox',
  description: `对话框是一种交互强反馈，需要用户主动干预并作出对应的响应。`,
  description_en: `MessageBox is a kind of interactive strong feedback, which requires user to intervene actively and respond accordingly. `,
  component: [
    {
      demo: BasicComponent,
      codePath: 'showcase/message-box/basic/basic.component',
      demoTitle: '信息弹窗',
      demoTitle_en: 'Basic',
      demoDescription: '快捷调用方式，只需传入内容字符串即可。分为成功、提示、警告、危险、错误。',
      demoDescription_en: `To quickly call the way, just pass in the content string. It can be divided into: Information, Success, Warning, Error, Danger.`,
    },
    {
      demo: ConfirmComponent,
      codePath: 'showcase/message-box/confirm/confirm.component',
      demoTitle: '确认弹窗',
      demoTitle_en: 'Basic',
      demoDescription: '根据界面操作的影响来确定弹窗的级别。',
      demoDescription_en: 'The level of Confirm box is determined according to the impact caused by the operation of the interface.',
    },
    {
      demo: CustomizeComponent,
      codePath: 'showcase/message-box/customize/customize.component',
      demoTitle: '自定义',
      demoTitle_en: 'Customize',
      demoDescription: '可传入一个 options 对象自定义对话框。',
      demoDescription_en: 'Can pass in an options object custom messageBox.',
    },
  ],
  mApi: [
    {
      name: 'MessageBox Service',
      name_en: 'MessageBox Service',
      api: [
        {
          attribute: 'confirm',
          type: 'fn',
          default: '--',
          description: `弹出确认对话框，调用方法：MessageboxService.confirm(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up confirmation messageBox, call method:MessageboxService.confirm(params),params can be an options object or string.`,
        },
        {
          attribute: 'info',
          type: 'fn',
          default: '--',
          description: `弹出提示对话框，调用方法：MessageboxService.info(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up info messageBox, call method:MessageboxService.info(params),params can be an options object or string.`,
        },
        {
          attribute: 'success',
          type: 'fn',
          default: '--',
          description: `弹出成功对话框，调用方法：MessageboxService.success(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up success messageBox, call method:MessageboxService.success(params)，params can be an options object or string.`,
        },
        {
          attribute: 'warning',
          type: 'fn',
          default: '--',
          description: `弹出警告对话框，调用方法：MessageboxService.warning(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up warning messageBox, call method:MessageboxService.warning(params),params can be an options object or string.`,
        },
        {
          attribute: 'error',
          type: 'fn',
          default: '--',
          description: `弹出错误对话框，调用方法：MessageboxService.error(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up error messageBox, call method:MessageboxService.error(params),params can be an options object or string.`,
        },
        {
          attribute: 'danger',
          type: 'fn',
          default: '--',
          description: `弹出危险对话框，调用方法：MessageboxService.danger(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up danger messageBox, call method：MessageboxService.danger(params),params can be an options object or string.`,
        },
      ],
      event: [],
    },
    {
      name: 'MessageBox Options ',
      name_en: 'MessageBox Options ',
      api: [
        {
          attribute: 'lvHeader',
          type: 'string | TemplateRef',
          default: '--',
          description: `对话框头部，支持字符串和 Template，默认值对应类型分别为：确认、提示、成功、告警、危险、错误。`,
          description_en: `The header of the messageBox box supports strings and Templates. The default values are: confirmation, prompt, success, alarm, danger, error.`,
        },
        {
          attribute: 'lvContent',
          type: 'string | TemplateRef',
          default: 'null',
          description: `对话框内容区，支持字符串 和 TemplateRef。`,
          description_en: `MessageBox content area, support string and TemplateRef.`,
        },
        {
          attribute: 'lvModalKey',
          type: 'string',
          default: 'null',
          description: `对话框的唯一性标识符，通过服务方式创建对话框时，请务必配置，以保证同一对话框的唯一性。`,
          description_en: `Unique identifier of modal. When you create a modal through service, you must configure it to ensure the uniqueness of the same modal.`,
        },
        {
          attribute: 'lvWidth',
          type: 'number | string',
          default: 'auto',
          description: `对话框宽度。`,
          description_en: `MessageBox width.`,
        },
        {
          attribute: 'lvHeight',
          type: 'number | string',
          default: 'auto',
          description: `对话框高度。`,
          description_en: `MessageBox height.`,
        },
        {
          attribute: 'lvIndex',
          type: 'number',
          default: '1000',
          description: `对话框层级 index。`,
          description_en: `MessageBox level: index。`,
        },
        {
          attribute: 'lvKeyboardEscape',
          type: 'boolean',
          default: 'false',
          description: `键盘事件，点击"ESC"键关闭对话框，默认不开启。`,
          description_en: `Keyboard event, click the "ESC" button to close the messageBox, the default is not open.`,
        },
        {
          attribute: 'lvDraggable',
          type: 'boolean',
          default: 'true',
          description: `是否可拖拽移动。`,
          description_en: `Whether to drag and move. `,
        },
        {
          attribute: 'lvOkLoading',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "OK" 的 Loading 状态。`,
          description_en: `Loading status of the default button "OK".`,
        },
        {
          attribute: 'lvCancelLoading',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "Cancel" 的 Loading 状态。`,
          description_en: `Loading status of the default button "Cancel".`,
        },
        {
          attribute: 'lvOkDisabled',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "OK" 的禁用状态。`,
          description_en: `Disabled state of default button "OK".`,
        },
        {
          attribute: 'lvCancelDisabled',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "Cancel" 的禁用状态。`,
          description_en: `Default button "Cancel" disabled state.`,
        },
        {
          attribute: 'lvOkText',
          type: 'string',
          default: 'Ok | 确定',
          description: `默认按钮 "OK" 的名称。`,
          description_en: `The name of the default button "OK".`,
        },
        {
          attribute: 'lvCancelText',
          type: 'string',
          default: 'Cancel | 取消',
          description: `默认按钮 "Cancel" 的名称。`,
          description_en: `The name of the default button "Cancel".`,
        },
        {
          attribute: 'lvOkType',
          type: 'primary | link | default',
          default: 'primary',
          description: `默认按钮 "OK" 的类型。`,
          description_en: `The type of the default button "OK".`,
        },
        {
          attribute: 'lvCancelType',
          type: 'primary | link | default',
          default: 'default',
          description: `默认按钮 "Cancel" 的类型。`,
          description_en: `The type of the default button "Cancel".`,
        },
        {
          attribute: 'lvOkLoadingText',
          type: 'string',
          default: 'Loading',
          description: `默认按钮 "OK" 的 Loading 文本。`,
          description_en: `The Loading text of the default button "OK".`,
        },
        {
          attribute: 'lvCancelLoadingText',
          type: 'string',
          default: 'Loading',
          description: `默认按钮 "Cancel" 的 Loading 文本。`,
          description_en: `The loading text for the default button "Cancel".`,
        },
        {
          attribute: 'lvCloseButtonDisplay',
          type: 'boolean',
          default: 'true',
          description: `关闭按钮的可见状态。`,
          description_en: `Turns off the visible state of the button.`,
        },
        {
          attribute: 'lvFocusButtonId',
          type: 'string',
          default: 'null',
          description: `设置当前对话框的焦点按钮；更改默认按钮 (Ok/Cancel) 的焦点，对应的ID分别为: 'ok'、'cancel'。`,
          description_en: `Set the focus button of current modal; change the focus of default button (OK/Cancel), the corresponding IDs of which are 'OK' and 'Cancel'.`,
        },
        {
          attribute: 'lvOuterClosable',
          type: 'boolean',
          default: 'false',
          description: `在弹窗外部点击时是否关闭对话框。`,
          description_en: `Whether to close the messageBox when clicking outside the popup.`,
        },
        {
          attribute: 'lvMaskTransparent',
          type: 'boolean',
          default: 'false',
          description: `遮罩是否透明。`,
          description_en: `Whether the mask is transparent.`,
        },
        {
          attribute: 'lvClass',
          type: 'string',
          default: 'null',
          description: `自定义弹窗样式。`,
          description_en: `Customize the pop-up style.`,
        },
        {
          attribute: 'lvDialogIcon',
          type: 'string',
          default: '--',
          description: `设置消息对话框的图标，值为SVG Symbol ID。`,
          description_en: `Set the icon of the message messageBox with a value of SVG Symbol ID.`,
        },
        {
          attribute: 'lvBeforeOpen',
          type: 'fn()',
          default: '--',
          description: `打开对话框前的回调函数，执行异步事件时返回promise，返回值为false可阻止打开。`,
          description_en: `Callback function before opening the messageBox. Promise will be returned when executing an asynchronous event. If the returned value is false, closing can be prevented.`,
        },
        {
          attribute: 'lvAfterOpen',
          type: 'fn(modal)',
          default: '--',
          description: `打开对话框后的回调函数。`,
          description_en: `Callback function after opening the messageBox.`,
        },
        {
          attribute: 'lvBeforeClose',
          type: 'fn(modal, result)',
          default: '--',
          description: `关闭对话框前的回调函数，传递当前 messageBox 实例和一个类型为 any 的参数。执行异步事件时返回promise，返回值为false可阻止关闭。`,
          description_en: `Callback function before closing the messageBox, transmit the current message-box instance and a parameter of type any. Promise will be returned when executing an asynchronous event. If the returned value is false, closing can be prevented.`,
        },
        {
          attribute: 'lvAfterClose',
          type: 'fn(result)',
          default: '--',
          description: `关闭对话框后的回调函数，传递一个类型为 any 的参数。`,
          description_en: `Callback function after closing the message-box, transmit a parameter of type any.`,
        },
        {
          attribute: 'lvOk',
          type: 'fn(modal)',
          default: '--',
          description: `点击对话框默认按钮 "OK" 时的执行函数，执行异步事件时返回promise，返回值为false可阻止关闭。`,
          description_en: `Executing function when clicking the default button 'OK' of the message-box. Promise will be returned when executing an asynchronous event. If the returned value is false, closing can be prevented.`,
        },
        {
          attribute: 'lvCancel',
          type: 'fn(modal)',
          default: '--',
          description: `点击对话框默认按钮 "Cancel" 时的执行函数，执行异步事件时返回 promise，返回值为false可阻止关闭。`,
          description_en: `Executing function when clicking the default button 'Cancel' of the message-box. Promise will be returned when executing an asynchronous event. If the returned value is false, closing can be prevented.`,
        },
      ],
      event: [],
    },
    {
      name: '全局配置',
      name_en: 'Global Configuration',
      api: [
        {
          attribute: 'lvWidth',
          type: 'number | string',
          default: 'auto',
          description: `对话框宽度。`,
          description_en: `message-box width.`,
        },
        {
          attribute: 'lvKeyboardEscape',
          type: 'boolean',
          default: 'false',
          description: `键盘事件，点击"ESC"键关闭对话框，默认不开启。`,
          description_en: `Keyboard event. Click 'ESC' to close the modal, which is turned off by default.`,
        },
        {
          attribute: 'lvOuterClosable',
          type: 'boolean',
          default: 'false',
          description: `在弹窗外部点击时是否关闭对话框。`,
          description_en: `Whether to turn off the modal when click the panel outside the modal.`,
        },
        {
          attribute: 'lvMaskTransparent',
          type: 'boolean',
          default: 'false',
          description: `遮罩是否透明。`,
          description_en: `Whether the mask is transparent.`,
        },
        {
          attribute: 'lvDraggable',
          type: 'boolean',
          default: 'true',
          description: `是否可拖拽移动。`,
          description_en: `Whether to drag and move. `,
        },
      ],
    },
  ],
};
